Skip to content

feat: update to latest json schema test suite #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 24, 2025

Conversation

DannyvdSluijs
Copy link
Collaborator

This pull request updates the json-schema/json-schema-test-suite dependency to a newer version and introduces a new test suite for validating JSON schemas. The goal here is to have a quicker turnaround then just the bowtie reports. The most important changes are grouped below:

Dependency Updates:

  • Updated json-schema/json-schema-test-suite dependency in composer.json from version 1.2.0 to ^23.2 and updated the package version and reference in the repositories section to match the new version. [1] [2]

New Test Suite:

  • Added a new JsonSchemaTestSuite class in tests/JsonSchemaTestSuite.php to run validation tests using the json-schema/json-schema-test-suite. This includes:
    • A testIt method to validate test cases and assert results.
    • A casesDataProvider method to dynamically load test cases from the json-schema-test-suite repository, skipping certain drafts.
    • A loadRemotesIntoStorage helper method to load remote schemas into the schema storage.

@DannyvdSluijs DannyvdSluijs force-pushed the upgrade-json-schema-test-suite branch from 45e4b9e to 64ad0c7 Compare May 2, 2025 12:21
@DannyvdSluijs DannyvdSluijs force-pushed the upgrade-json-schema-test-suite branch 3 times, most recently from 970acdd to 8875da9 Compare May 2, 2025 13:40
@DannyvdSluijs DannyvdSluijs force-pushed the upgrade-json-schema-test-suite branch from ee860de to 1e458b3 Compare May 13, 2025 19:23
@DannyvdSluijs DannyvdSluijs force-pushed the upgrade-json-schema-test-suite branch from c9ae357 to b67dc06 Compare June 3, 2025 18:33
@DannyvdSluijs DannyvdSluijs marked this pull request as ready for review June 3, 2025 18:33
@DannyvdSluijs DannyvdSluijs force-pushed the upgrade-json-schema-test-suite branch from b67dc06 to 0ae67f3 Compare June 3, 2025 18:35
@DannyvdSluijs DannyvdSluijs force-pushed the upgrade-json-schema-test-suite branch 2 times, most recently from b6db705 to 04a0263 Compare June 11, 2025 17:46
@DannyvdSluijs DannyvdSluijs force-pushed the upgrade-json-schema-test-suite branch 3 times, most recently from ae4a833 to 5185c14 Compare June 24, 2025 09:57
@DannyvdSluijs DannyvdSluijs force-pushed the upgrade-json-schema-test-suite branch from 5185c14 to 5c92ede Compare June 24, 2025 10:30
@DannyvdSluijs DannyvdSluijs requested a review from Copilot June 24, 2025 14:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the JSON Schema Test Suite dependency and introduces new test cases for validating JSON schemas. Key changes include dependency upgrades in composer.json, the addition of new test classes (including JsonSchemaTestSuiteTest), and updates to existing test cases and helper methods to support the newer dependency version.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/JsonSchemaTestSuiteTest.php New test suite to load and run JSON Schema test cases.
tests/Drafts/Draft4Test.php & tests/Drafts/Draft3Test.php Updated draft-based test generators with additional skipped tests.
tests/Constraints/VeryBaseTestCase.php Added a helper to detect 32-bit environments.
tests/Constraints/NumberAndIntegerTypesTest.php Updated test cases with keyed input for clarity.
tests/Constraints/BaseTestCase.php Improved type hints and added custom error messages for validator errors.
phpunit.xml.dist Increased memory limit configuration for tests.
composer.json Upgraded JSON Schema Test Suite dependency to version 23.2.0.
Comments suppressed due to low confidence (1)

tests/JsonSchemaTestSuiteTest.php:41

  • [nitpick] The error message 'Optional test case would during validate() invocation' is ambiguous; consider revising it to clearly indicate that the test case is being skipped due to an exception during validation.
                $this->markTestSkipped('Optional test case would during validate() invocation');

@DannyvdSluijs DannyvdSluijs merged commit 3763af1 into master Jun 24, 2025
16 checks passed
@DannyvdSluijs DannyvdSluijs deleted the upgrade-json-schema-test-suite branch June 24, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant